    <template>
  <div>
    <el-breadcrumb>
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>订单管理</el-breadcrumb-item>
      <el-breadcrumb-item>订单列表</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-row>
        <el-col :span="8">
          <el-input clearable @clear='getOrdersList' placeholder="请输入内容" v-model="queryInfo.query">
            <el-button @click="getOrdersList" slot="append" icon="el-icon-search"></el-button>
          </el-input>
        </el-col>
      </el-row>
      <el-table :data="ordersList" border stripe style="width: 100%">
        <el-table-column type="index" label="#" width="50">
        </el-table-column>
        <el-table-column prop="order_number" label="订单编号">
        </el-table-column>
        <el-table-column prop="order_price" label="订单价格" width="100">
        </el-table-column>
        <el-table-column prop="order_number" label="是否付款" width="100">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.order_pay=== '0' ">未付款</el-tag>
            <el-tag v-else>已付款</el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="is_send" label="是否发货" width="100">
        </el-table-column>
        <el-table-column label="下单时间" width="180">
          <template slot-scope='scope'>
            {{ scope.row.create_time |dateFormat}}
          </template>
        </el-table-column>
        <el-table-column label="操作" width="150">
          <template slot-scope="scope">
            <el-button @click="showEditDialog(scope.row) " size="mini" type="primary" icon="el-icon-edit"></el-button>
            <el-button @click='showaddressDialog' size="mini" type="success" icon="el-icon-location"></el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pagenum" :page-sizes="[3, 8, 10, 20,30]" :page-size="queryInfo.pagesize" layout="total, sizes, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </el-card>
    <!-- 修改地址 -->
    <el-dialog title="修改地址" @close='editDialogClose' :visible.sync="editDialogVisible" width="50%">
      <el-form :model="editForm" :rules="editFormRules" ref="editFormRef" label-width="100px">
        <el-form-item label="省市区/县" prop="address1">
          <el-cascader v-model="address1" :options="CityData" :props="{ expandTrigger: 'hover', checkStrictly: true
            }"></el-cascader>
        </el-form-item>
        <el-form-item label="详细地址" prop="address2">
          <el-input v-model="editForm.address2"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="editDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 查看物流 -->
    <el-dialog title="物流进度" :visible.sync="addressDialogVisible" width="50%">
      <el-timeline :reverse="reverse">
        <el-timeline-item v-for="(activity, index) in addressList" :key="index" :timestamp="activity.time">
          {{activity.context}}
        </el-timeline-item>
      </el-timeline>
    </el-dialog>
  </div>
</template>
<script>
import CityData from './citydata'
export default {
  data() {
    return {
      queryInfo: {
        query: '',
        pagesize: 3,
        pagenum: 1
      },
      ordersList: [],
      total: 0,
      CityData: CityData,
      editDialogVisible: false,
      editForm: {
        address1: [],
        address2: ''
      },
      editFormRules: {
        address2: [{ required: true, message: '请输入详细地址', trigger: 'blur' }]
      },
      addressDialogVisible: false,
      addressList: []
    }
  },
  created() {
    this.getOrdersList()
  },
  methods: {
    async getOrdersList() {
      const { data: res } = await this.$http.get('orders', {
        params: this.queryInfo
      })
      if (res.meta.status !== 200) {
        return this.$message.error()
      }
      this.ordersList = res.data.goods
      this.total = res.data.total
    },
    handleCurrentChange(page) {
      this.queryInfo.pagenum = page
      this.getOrdersList()
    },
    handleSizeChange(size) {
      this.queryInfo.pagesize = size
      this.getOrdersList()
    },
    async showEditDialog(id) {
      this.editDialogVisible = true
    },
    editDialogClose() {
      this.$refs.editFormRef.resetFields()
    },
    async showaddressDialog() {
      const { data: res } = await this.$http.get('/kuaidi/1106975712662')
      if (res.meta.status !== 200) {
        return this.$message.error('获取物流信息失败！')
      }
      this.addressDialogVisible = true
      this.addressList = res.data
    }
  }
}
</script>

获取物流信息成功！
<style lang="less" scoped>
.el-cascader {
  width: 100%;
}
</style>
